import 'package:changxindianzishangwu/cache/local_cache.dart';
import 'package:changxindianzishangwu/http/base/ec_base_request.dart';
import 'package:changxindianzishangwu/http/request/settings_status_request.dart';
import 'package:changxindianzishangwu/http/request/settings_update_say_request.dart';
import 'package:changxindianzishangwu/http/zd_net.dart';
import 'package:changxindianzishangwu/model/user_info_model.dart';
import 'package:changxindianzishangwu/model/user_settings_model.dart';

///设置=>聊天管理
class SettingsDao {
  /// 获取用户设置信息（包含忙碌等状态信息）
  static getUserSettings()async {
    EcBaseRequest request=SettingsStatusRequest();
    request.add("userId", getUserInfo().userId);
    request.add("access_token", getAppLoginToken());
    var result= await ZdNet.getInstance().send(request);
    return UserSettingsModel.fromJson(result);
  }
  static updateSettingsSayHello(String key,int value)async{
    EcBaseRequest request=SettingsUpdateSayRequest();
    request.add(key, value);
    request.add("access_token", getAppLoginToken());
    return await ZdNet.getInstance().send(request);
  }
}
